

#ifndef BFALCOR_RENDERPASSREFLECTION_H
#define BFALCOR_RENDERPASSREFLECTION_H

#include "PreStd.h"
namespace Bonnie{

    class RenderPassReflection {
    public:
        class Field{
        public:

            enum class Type{
                Texture2D
            };

            enum class Visibility{
                Undefined = 0,
                Input = 0x1,
                Output = 0x2
            };

            Field(const std::string& name,const std::string& desc,Visibility v):mName(name),mDesc(desc),mVisibility(v){}

            Visibility getVisibility() const { return mVisibility; }
            const std::string& getName() const { return mName; }

            bool isCompatiable(const Field& rhs) {
                return true;
            }
        private:
            friend class RenderPassReflection;
            std::string mName;
            std::string mDesc;
            Type mType = Type::Texture2D;
            Visibility mVisibility = Visibility::Undefined;
        };

        Field& addInput(const std::string& name,const std::string& desc = "");
        Field& addOutput(const std::string& name,const std::string& desc = "");

        size_t getFieldCount() const { return mFields.size(); }
        const Field* getField(size_t f) const { return f <= mFields.size() ? &mFields[f] : nullptr; }
    private:
        class RenderGraph;
        friend class RenderGraph;
        Field& addField(const std::string& name,const std::string& desc,Field::Visibility v);
        std::vector<Field> mFields;
    };


}
#endif //BFALCOR_RENDERPASSREFLECTION_H
